﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using SubSonic;
using CXDB;
/// <summary>
///LogRecord 的摘要说明
/// </summary>
public class LogRecord
{
	public LogRecord()
	{
		//
		//TODO: 在此处添加构造函数逻辑
		//
	}
    /// <summary>
    /// 增加日志记录
    /// </summary>
    /// <param name="g">Guid</param>
    /// <param name="uid">用户编号</param>
    /// <param name="remark">意见</param>
    /// <param name="tStatus">审核状态</param> 
    public static void Add(Guid g,int uid,string remark,int tStatus)
    {
        //更新原有记录
        Query q=new Query(CxRemark.Schema);
        q.AddWhere("uid", uid);
        q.AddWhere("guid", g);
        q.AddWhere("status", 0);
        q.Execute();
        //增加新的记录
        CxRemark cx = new CxRemark();
        cx.Guid = g;
        cx.UID = uid;
        cx.TStatus = tStatus;
        cx.Status = 1;
        cx.Remark = remark;
        cx.InTime = DateTime.Now;
        cx.Save();
    }
}
